--  "Elerta"

function autoexec()
  if (get_treasure(1) == 1) then
    set_obs(36,27,0);
 --   set_progress(MESRA, 1);
      end
end

function refresh()
  return
end

function postexec()
end

function zone_handler(zn)
  if (zn == 1) then
    change_map("myland",109,57,109,57);

  elseif (zn == 2) then
    touch_fire(get_pidx(0));

  elseif (zn == 3) then
    door_in(66,22,62,14,70,24);

  elseif (zn == 4) then
    door_in(66,8,62,0,70,10);

  elseif (zn == 5) then
    door_in(81,8,77,0,85,10);

  elseif (zn == 6) then
    door_in(54,22,50,14,58,24);

  elseif (zn == 7) then
    door_in(54,8,50,0,58,9);

  elseif (zn == 8) then
    thought(HERO1,"The door is locked")

  elseif (zn == 9) then
    door_out(7,27)

  elseif (zn == 10) then
    door_out(32,28)

  elseif (zn == 11) then
    door_out(35,12)

  elseif (zn == 12) then
    door_out(16,5)

  elseif (zn == 13) then
    door_out(3,12)

  elseif (zn == 14) then
    chest(1,I_MESRA,1);
    set_obs(36,27,0);
 --   set_progress(MESRA, 1);

  elseif  (zn == 15) then
    inn("Dew Drop Inn",20,3);

  elseif (zn == 16) then
    thought(HERO1,"You stop and smell the flowers.")



  end
end

function entity_handler(en)
  if (en == 0) then
    bubble(0,"Ari?");
    bubble(0,"Wheres Ari?");

  elseif  (en == 1) then
    bubble(1,"This is the worst thing that has happened to this town.");

  elseif  (en == 2) then
    bubble(2,"I wish I was a forester instead.");
    bubble(2,"Being on the council is too hard.");

  elseif  (en == 3) then
        if (get_treasure(1) == 0) then
    bubble(3,"Everyone else is too distraught to tell you what happened.");
    bubble(3,"I am too but...");
    bubble(3,"Heres what happened:");
    bubble(3,"Two nights ago, Ari went missing from her home. She lived with the old lady.");
    bubble(3,"Theres not much more to say... She was there and then in the morning she was gone!");
    bubble(3,"Feel free to explore around her house.");
else
   --if (get_progress(MESRA) == 1) then
    bubble(HERO1,"I found this Mesra feather near that old lady's house.");
    bubble(3,"Hmm... I dont know what that means.");
    bubble(3,"But you could try bringing it to one of the sailors in the port town of Sallar.");
    bubble(3,"My brother's a sailor. He would probably know.");
end

  elseif  (en == 4) then
    bubble(4,"This is going to ruin me!! What am I to do?");
    bubble(4,"mumble... mumble... the King is going to kill me! mumble... mumble...");

  elseif  (en == 5) then
  if (get_treasure(1) == 0) then
    bubble(5,"Welcome Hero, to the village of Elerta.");
    bubble(5,"The Village Council is waiting for you in the hut just North of here.");
else
    bubble(5,"I hope that you will succeed.");
end
  elseif  (en == 6) then
    inn("Dew Drop Inn",20,3);




end
       end

